package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GxDepartmentMapper;
import com.ruoyi.system.domain.GxDepartment;
import com.ruoyi.system.service.IGxDepartmentService;

/**
 * 科室管理Service业务层处理
 *
 * @author pqj
 * @date 2023-01-06
 */
@Service
public class GxDepartmentServiceImpl implements IGxDepartmentService
{
    @Autowired
    private GxDepartmentMapper gxDepartmentMapper;

    /**
     * 查询科室管理
     *
     * @param id 科室管理主键
     * @return 科室管理
     */
    @Override
    public GxDepartment selectGxDepartmentById(Integer id)
    {
        return gxDepartmentMapper.selectGxDepartmentById(id);
    }

    /**
     * 查询科室管理列表
     *
     * @param gxDepartment 科室管理
     * @return 科室管理
     */
    @Override
    public List<GxDepartment> selectGxDepartmentList(GxDepartment gxDepartment)
    {
        return gxDepartmentMapper.selectGxDepartmentList(gxDepartment);
    }

    /**
     * 新增科室管理
     *
     * @param gxDepartment 科室管理
     * @return 结果
     */
    @Override
    public int insertGxDepartment(GxDepartment gxDepartment)
    {
        gxDepartment.setCreateTime(DateUtils.getNowDate());
        return gxDepartmentMapper.insertGxDepartment(gxDepartment);
    }

    /**
     * 修改科室管理
     *
     * @param gxDepartment 科室管理
     * @return 结果
     */
    @Override
    public int updateGxDepartment(GxDepartment gxDepartment)
    {
        gxDepartment.setUpdateTime(DateUtils.getNowDate());
        return gxDepartmentMapper.updateGxDepartment(gxDepartment);
    }

    /**
     * 批量删除科室管理
     *
     * @param ids 需要删除的科室管理主键
     * @return 结果
     */
    @Override
    public int deleteGxDepartmentByIds(Integer[] ids)
    {
        return gxDepartmentMapper.deleteGxDepartmentByIds(ids);
    }

    /**
     * 删除科室管理信息
     *
     * @param id 科室管理主键
     * @return 结果
     */
    @Override
    public int deleteGxDepartmentById(Integer id)
    {
        return gxDepartmentMapper.deleteGxDepartmentById(id);
    }
}

